package com.lkd.mapper;

import com.lkd.entity.Role;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface RoleMapper {
    //根据id查询
    @Select("select * from lkdremake.tb_role where role_id=#{roleId}")
    Role getById(Integer roleId);

    //根据id查询角色code
    @Select("select role_code from lkdremake.tb_role where role_id=#{roleId}")
    String getRoleCodeById(Integer roleId);

    //查询所有角色
    @Select("select * from lkdremake.tb_role")
    List<Role> list();
}
